package com.yilin.medical.lsh;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.Test;

import com.google.gson.reflect.TypeToken;

public class Http {

	@SuppressWarnings("unchecked")
	@Test
	public void sync() {
		Post4_1 post = new Post4_1();
		post.setId(4);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<CommonIndex>>() {
		}.getType();
		BaseResult<CommonIndex> result;
		try {
			System.out.println(NetHelper.httpPost(HttpApis.index, params));
			result = (BaseResult<CommonIndex>) JsonUtil.jsonToBean(
					NetHelper.httpPost(HttpApis.index, params), type);
			System.out.println(result.getData().toString());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}

	}

	@SuppressWarnings("unchecked")
	@Test
	public void CommonDictArea() {
		Post4_1 post = new Post4_1();
		post.setId(100000);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Area>>() {
		}.getType();
		BaseResult<Area> result;
		try {
			System.out.println(NetHelper.httpPost(HttpApis.area, params));
			result = (BaseResult<Area>) JsonUtil.jsonToBean(
					NetHelper.httpPost(HttpApis.area, params), type);
			System.out.println(result.getData().getChildren().size());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void SmsSendCode() {
		Post4_3 post = new Post4_3();
		post.setMobile("18513951731");
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.sendSmsCode, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void sector() {
		Post4_1 post = new Post4_1();
		post.setId(26);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Sector>>() {
		}.getType();
		BaseResult<Sector> result;
		try {
			String str = NetHelper.httpPost(HttpApis.sector, params);
			System.out.println(str);
			result = (BaseResult<Sector>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void banner() {

		Type type = new TypeToken<BaseResult<Map<String, Banner>>>() {
		}.getType();
		BaseResult<Map<String, Banner>> result;
		try {

			String str = NetHelper.httpPost(HttpApis.banner,
					new HashMap<String, Object>());
			System.out.println(str);
			result = (BaseResult<Map<String, Banner>>) JsonUtil.jsonToBean(str,
					type);
			System.out.println(result.getData().size());
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}

	}

	@SuppressWarnings("unchecked")
	@Test
	public void regist() {
		Post5_1 post = new Post5_1();
		post.setAddress("北京市海淀区中关村五道口");
		post.setArea1(110000);
		post.setArea2(110100);
		post.setArea3(110101);
		post.setChooseHospital(2014);
		post.setDegree(3);
		post.setDepartment(100);
		post.setEmail("liushenghan@outlook.com");
		post.setHospitalLevel(2);
		post.setHospitalName("北京安贞医院");
		post.setName("liushenghan");
		post.setPassword("123456789");
		post.setPosition(10);
		post.setProfesson(10);
		post.setSex(1);
		post.setSmscode("696754");
		post.setSortchar("L");
		post.setTel("18513951731");
		post.setTitle(1);
		post.setUsername("18513951731");
		post.setZipCode("100000");
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Regist>>() {
		}.getType();
		BaseResult<Regist> result;
		try {
			String str = NetHelper.httpPost(HttpApis.regist, params);
			System.out.println(str);
			result = (BaseResult<Regist>) JsonUtil.jsonToBean(str, type);

			if (result.getData() != null) {
				System.out.println("结果 = " + result.getData());
			}
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void login() {
		Post5_2 post = new Post5_2();
		post.setUsername("18513951731");
		post.setPassword("123456789");
		post.setIsRemember(1);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<UserInfo>>() {
		}.getType();
		BaseResult<UserInfo> result;
		try {
			String str = NetHelper.httpPost(HttpApis.login, params);
			System.out.println(str);
			result = (BaseResult<UserInfo>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void getVisitor() {
		Post5_3 post = new Post5_3();
		post.setUid(12);
		post.setN(20);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<List<BaseInfo>>>() {
		}.getType();
		BaseResult<List<BaseInfo>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.visitor, params);
			System.out.println(str);
			result = (BaseResult<List<BaseInfo>>) JsonUtil
					.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void info() {
		Post5_3 post = new Post5_3();
		post.setUid(24);
		post.setN(20);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<UserInfo>>() {
		}.getType();
		BaseResult<UserInfo> result;
		try {
			String str = NetHelper.httpPost(HttpApis.info, params);
			System.out.println(str);
			result = (BaseResult<UserInfo>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void visit() {
		Post5_3 post = new Post5_3();
		post.setUid(0);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.visit, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);

			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void password() {
		Post5_6 post = new Post5_6();
		post.setOldpassword("123456788");
		post.setNewpassword("123456789");
		post.setNewpasswordRe("123456789");
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.password, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);

			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void comment() {
		Post5_7 post = new Post5_7();
		post.setId(203);
		post.setType(4);
		post.setContent("niubi");
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.comment, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void reply() {
		Post5_7 post = new Post5_7();
		post.setId(203);
		post.setContent("niubi");
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.reply, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void zan() {
		Post5_7 post = new Post5_7();
		post.setId(203);
		post.setType(4);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.zan, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void editNote() {
		Post5_7 post = new Post5_7();
		post.setId(203);
		post.setType(4);
		post.setTitle("ceshi");
		post.setIsSend(0);
		post.setContent("ceshi 内容");
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.editNote, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void editVideo() {
		Post5_7 post = new Post5_7();
		post.setId(0);
		post.setTitle("视频");
		post.setContent("xxxooo");
		post.setPic("");
		post.setVideo("");
		post.setIsSend(0);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.editVideo, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void editWeibo() {
		Post5_7 post = new Post5_7();
		post.setId(123);
		post.setContent("更改微博");
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.editWeibo, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block

			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void del() {
		Post5_7 post = new Post5_7();
		post.setId(87977979);
		post.setType(1);
		Map<String, Object> params = post.toMap(post);

		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.del, params);
			System.out.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (SimpleException e) {
			// TODO Auto-generated catch block

			BaseBean convertToBean = e.convertToBean(type);
			System.out.println(convertToBean.getSimpleException().getMessage());
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void upload() {
		Post5_14 post = new Post5_14();
		post.setType("pic");
		post.setFile("C://screen1.bmp");

		Type type = new TypeToken<BaseResult<UploadFile>>() {
		}.getType();
		BaseResult<UploadFile> result;
		try {
			String str = MyHttpClient.uploadFile(HttpApis.uploadFile, post);
			System.err.println(str);
			result = (BaseResult<UploadFile>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void setPassword() {
		Post5_15 post = new Post5_15();
		post.setNewpassword("12345345");
		post.setNewpasswordRe("1234535");
		post.setSmscode("234567");
		post.setUsername("12345678912");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.setPassword, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void editQuanzi() {
		Post5_16 post = new Post5_16();
		post.setId(0);
		post.setName("我的圈子XXdfafa");
		post.setType(26);
		post.setPic("http://123.jpg");
		post.setExplain("ceshi");
		post.setSessionID("abc9dc0fm8eGH0dAJj/Lp7ogENHflWnZKxuH60d9z4+95/+0BNxndyiiewN285jaAwsHWZ6i+BcWwvjYhGC8lg");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.editQuanzi, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void joinQuanzi() {
		Post5_16 post = new Post5_16();
		post.setId(11);
		post.setSessionID("abc9dc0fm8eGH0dAJj/Lp7ogENHflWnZKxuH60d9z4+95/+0BNxndyiiewN285jaAwsHWZ6i+BcWwvjYhGC8lg");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.joinQuanzi, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void addFriend() {
		Post5_18 post = new Post5_18();
		post.setUid(9999);
		post.setSessionID("abc9dc0fm8eGH0dAJj/Lp7ogENHflWnZKxuH60d9z4+95/+0BNxndyiiewN285jaAwsHWZ6i+BcWwvjYhGC8lg");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.addFriend, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void delFriend() {
		Post5_18 post = new Post5_18();
		post.setUid(16);
		post.setSessionID("abc9dc0fm8eGH0dAJj/Lp7ogENHflWnZKxuH60d9z4+95/+0BNxndyiiewN285jaAwsHWZ6i+BcWwvjYhGC8lg");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.delFriend, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	// myFriends
	@SuppressWarnings("unchecked")
	@Test
	public void myFriends() {
		Post5_20 post = new Post5_20();
		post.setKeyword("l");
		post.setPage(0);
		post.setSize(30);
		post.setSessionID("abc9dc0fm8eGH0dAJj/Lp7ogENHflWnZKxuH60d9z4+95/+0BNxndyiiewN285jaAwsHWZ6i+BcWwvjYhGC8lg");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.myFriends, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void GZUsers() {
		Post5_18 post = new Post5_18();
		post.setUid(24);
		post.setN(300);
		post.setSessionID("abc9dc0fm8eGH0dAJj/Lp7ogENHflWnZKxuH60d9z4+95/+0BNxndyiiewN285jaAwsHWZ6i+BcWwvjYhGC8lg");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Map<String, UserInfo>>>() {
		}.getType();
		BaseResult<Map<String, UserInfo>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.GZUsers, params);
			System.err.println(str);
			result = (BaseResult<Map<String, UserInfo>>) JsonUtil.jsonToBean(
					str, type);
			System.out.println(result.getData().size());
			System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unused")
	@Test
	public void getWeibo() {
		Post5_20 post = new Post5_20();
		post.setUid(0);
		post.setPage(0);
		post.setSize(30);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Map<String, UserInfo>>>() {
		}.getType();
		BaseResult<Map<String, UserInfo>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getWeibo, params);
			System.err.println(str);
			// result = (BaseResult<Map<String, UserInfo>>) JsonUtil.jsonToBean(
			// str, type);
			// System.out.println(result.getData().size());
			// System.out.println(result.getData().toString());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void getQuanzi() {
		Post5_23 post = new Post5_23();
		post.setUid(23);
		post.setId(12);
		post.setName("我的");
		post.setPage(1);
		post.setSize(1000);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<QuanZi>>>() {
		}.getType();
		BaseResult<SearchResult<QuanZi>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getQuanzi, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<QuanZi>>) JsonUtil.jsonToBean(
					str, type);

			System.out.println(result.getData().getRs().get(0).getUser()
					.getUsername());
			System.out.println(result.getData().getRs().get(0).getExplain());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings({ "unchecked", "unused" })
	@Test
	public void myQuanziWeibo() {
		Post5_23 post = new Post5_23();
		post.setPage(0);
		post.setSize(1000);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<WeiboDynamic>>() {
		}.getType();
		BaseResult<WeiboDynamic> result;
		try {
			String str = NetHelper.httpPost(HttpApis.myQuanziWeibo, params);
			System.err.println(str);
			result = (BaseResult<WeiboDynamic>) JsonUtil.jsonToBean(str, type);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings({ "unchecked", "unused" })
	@Test
	public void guestbook() {
		Post5_25 post = new Post5_25();
		post.setName("");
		post.setContent("nihaoa ceshimeizi ");
		post.setEmail("liushenghan@outlook.com");
		post.setMobile("18513951731");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.myQuanziWeibo, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings({ "unchecked", "unused" })
	@Test
	public void getNote() {
		Post5_26 post = new Post5_26();
		post.setId(1);
		post.setUid(24);
		post.setType(6);
		post.setPage(0);
		post.setSize(1000);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<WeiboDynamic>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getNote, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings({ "unchecked", "unused" })
	@Test
	public void getVideo() {
		Post5_26 post = new Post5_26();
		post.setId(1);
		post.setUid(24);
		post.setPage(0);
		post.setSize(1000);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<WeiboDynamic>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getVideo, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings({ "unchecked", "unused" })
	@Test
	public void sign() {
		BaseRequest post = new BaseRequest();
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result = null;
		try {
			String str = NetHelper.httpPost(HttpApis.sign, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings({ "unchecked", "unused" })
	@Test
	public void getUser() {
		Post5_23 post = new Post5_23();
		post.setName("lsh");
		post.setPage(0);
		post.setSize(100);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getUser, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings({ "unchecked", "unused" })
	@Test
	public void getFriends() {
		Post5_23 post = new Post5_23();
		post.setUid(24);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getFriends, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void getQuanziWeibo() {
		Post5_23 post = new Post5_23();
		post.setId(23);
		post.setPage(0);
		post.setSize(100);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<QuanziWeibo<Object>>>() {
		}.getType();
		BaseResult<QuanziWeibo<Object>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getQuanziWeibo, params);
			System.err.println(str);
			result = (BaseResult<QuanziWeibo<Object>>) JsonUtil.jsonToBean(str,
					type);
			System.out.println(result.getData().getWeiboList().getSize());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void editCase() {
		Post5_32 post = new Post5_32();
		post.setId(0);
		post.set_tid(23);
		post.setTitle("测试病例");
		post.setFile("www.baidu.com");
		post.setContent("nimahaoma ");
		post.setIsVMeeting(1);
		post.setQuestion("你好吗");
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.editCase, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void hospital() {
		Post6_1 post = new Post6_1();
		post.set_tid(23);
		post.setPage(0);
		post.setSize(100);
		post.setOrderby(0);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Hospital>>>() {
		}.getType();
		BaseResult<SearchResult<Hospital>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.hospital, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Hospital>>) JsonUtil.jsonToBean(
					str, type);
			System.out.println(result.getData().getTotal() + ""
					+ result.getData().getSize());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void expert() {
		Post6_1 post = new Post6_1();
		post.set_tid(23);
		post.setPage(0);
		post.setSize(100);
		post.setOrderby(0);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Expert>>>() {
		}.getType();
		BaseResult<SearchResult<Expert>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.expert, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Expert>>) JsonUtil.jsonToBean(
					str, type);
			System.out.println(result.getData().getTotal() + ""
					+ result.getData().getSize());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void course() {
		Post6_1 post = new Post6_1();
		post.set_tid(26);
		post.setPage(0);
		post.setSize(100);
		post.setOrderby(0);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Course>>>() {
		}.getType();
		BaseResult<SearchResult<Course>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.course, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Course>>) JsonUtil.jsonToBean(
					str, type);
			System.out.println(result.getData().getTotal() + ""
					+ result.getData().getSize());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void help() {
		Post6_4 post = new Post6_4();
		post.setId(2);
		post.setTitle("*");
		post.setContent("nihaoma");
		post.setSequence(3);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Course>>>() {
		}.getType();
		BaseResult<SearchResult<Course>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.help, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Course>>) JsonUtil.jsonToBean(
					str, type);
			System.out.println(result.getData().getTotal() + ""
					+ result.getData().getSize());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void guide() {
		Post6_1 post = new Post6_1();
		post.set_tid(26);
		post.setType(1);
		post.setPage(0);
		post.setSize(100);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Guid>>>() {
		}.getType();
		BaseResult<SearchResult<Guid>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.guide, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Guid>>) JsonUtil.jsonToBean(str,
					type);
			System.out.println(result.getData().getTotal() + ""
					+ result.getData().getSize());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void commonCourse() {
		Post6_4 post = new Post6_4();
		post.setId(2);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Object>>() {
		}.getType();
		BaseResult<Object> result;
		try {
			String str = NetHelper.httpPost(HttpApis.commonCourse, params);
			System.err.println(str);
			result = (BaseResult<Object>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void meeting() {
		Post6_1 post = new Post6_1();
		post.set_tid(23);
		post.setType(1);
		post.setPage(0);
		post.setSize(100);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Meeting>>>() {
		}.getType();
		BaseResult<SearchResult<Meeting>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.meeting, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Meeting>>) JsonUtil.jsonToBean(
					str, type);
			System.out.println(result.getData());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void meetingInfo() {
		Post6_4 post = new Post6_4();
		post.setId(1);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<MeetInfo>>() {
		}.getType();
		BaseResult<MeetInfo> result;
		try {
			String str = NetHelper.httpPost(HttpApis.meetingInfo, params);
			System.err.println(str);
			result = (BaseResult<MeetInfo>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().getUid());
			System.out.println(result.getData().getAdminId());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void Case() {
		Post6_1 post = new Post6_1();
		post.set_tid(23);
		post.setUid(24);
		post.setPage(0);
		post.setSize(1000);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Case>>>() {
		}.getType();
		BaseResult<SearchResult<Case>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.Case, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Case>>) JsonUtil.jsonToBean(str,
					type);
			System.out.println(result.getData().getRs().get(0).getId());
			System.out.println(result.getData().getRs().get(0).getFile());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void CaseInfo() {
		Post6_4 post = new Post6_4();
		post.setId(64);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Case>>() {
		}.getType();
		BaseResult<Case> result;
		try {
			String str = NetHelper.httpPost(HttpApis.caseInfo, params);
			System.err.println(str);
			result = (BaseResult<Case>) JsonUtil.jsonToBean(str, type);
			System.out.println(result.getData().getId());
			System.out.println(result.getData().getUpdateTime());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void getnew() {
		Post6_13 post = new Post6_13();
		post.setUsertype(0);
		post.setN(100);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<Map<String, NewLog>>>() {
		}.getType();
		BaseResult<Map<String, NewLog>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.getnew, params);
			System.err.println(str);
			result = (BaseResult<Map<String, NewLog>>) JsonUtil.jsonToBean(str,
					type);
			System.out.println(result.getData().size());
			System.out.println(result.getData().get("0").getContent());
			System.out.println(result.getData().get("0").getUser()
					.getUsername());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void casemeeting() {
		Post6_13 post = new Post6_13();
		post.setUsertype(0);
		post.setN(100);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Case>>>() {
		}.getType();
		BaseResult<SearchResult<Case>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.casemeeting, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Case>>) JsonUtil.jsonToBean(str,
					type);
			System.out.println(result.getData());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@SuppressWarnings("unchecked")
	@Test
	public void caseMeetingInfo() {
		Post6_13 post = new Post6_13();
		post.setUsertype(0);
		post.setN(77);
		Map<String, Object> params = post.toMap(post);
		Type type = new TypeToken<BaseResult<SearchResult<Case>>>() {
		}.getType();
		BaseResult<SearchResult<Case>> result;
		try {
			String str = NetHelper.httpPost(HttpApis.caseMeetingInfo, params);
			System.err.println(str);
			result = (BaseResult<SearchResult<Case>>) JsonUtil.jsonToBean(str,
					type);
			System.out.println(result.getData());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public interface HttpApis {
		String httpUrl = "http://cms.coolni.cn/api.php/";
		String accessKey = "0c5a3e8915871b710c2cc98073748424";
		String index = httpUrl + "common/dict/index";
		String area = httpUrl + "common/dict/area";
		String sendSmsCode = httpUrl + "common/sms/sendCode";
		String sector = httpUrl + "common/dict/getSector";
		String banner = httpUrl + "common/dict/banner";

		// String banner = httpUrl + "common/dict/playpic ";
		String regist = httpUrl + "user/index/reg";
		String login = httpUrl + "user/index/login";
		String visitor = httpUrl + "user/index/getVisitor";
		String info = httpUrl + "user/index/info";
		String visit = httpUrl + "user/user/visit";
		String password = httpUrl + "user/user/password";
		String comment = httpUrl + "user/user/comment";
		String reply = httpUrl + "user/user/reply";
		String zan = httpUrl + "user/user/zan";
		String editNote = httpUrl + "user/user/editNote";
		String editVideo = httpUrl + "user/user/editNote";
		String editWeibo = httpUrl + "user/user/editWeibo";
		String del = httpUrl + "user/user/del";
		String uploadFile = httpUrl + "user/user/uploadFile";
		String setPassword = httpUrl + "user/index/setPassword";
		String editQuanzi = httpUrl + "user/user/editQuanzi";
		String joinQuanzi = httpUrl + "user/user/joinQuanzi";
		String addFriend = httpUrl + "user/user/addFriend";
		String delFriend = httpUrl + "user/user/delFriend";
		String myFriends = httpUrl + "user/user/myFriend";
		String GZUsers = httpUrl + "user/user/GZUsers";
		String getWeibo = httpUrl + "user/user/getWeibo";

		String getQuanzi = httpUrl + "user/index/getQuanzi";
		String myQuanziWeibo = httpUrl + "user/user/myQuanziWeibo";
		String getNote = httpUrl + "user/index/getNote";
		String getVideo = httpUrl + "user/index/getVideo";
		String sign = httpUrl + "user/user/sign";
		String getUser = httpUrl + "user/user/getUser";
		String getFriends = httpUrl + "user/user/getFriends";
		String getQuanziWeibo = httpUrl + "user/index/getQuanziWeibo";
		String editCase = httpUrl + "user/user/editCase";

		String hospital = httpUrl + "common/hospital/search";
		String expert = httpUrl + "common/expert/search";
		String course = httpUrl + "common/course/search";
		String help = httpUrl + "common/dict/help";
		String guide = httpUrl + "common/guide/search";
		String commonCourse = httpUrl + "common/course/info";
		String commonHospital = httpUrl + "common/hospital/info";
		String commonExpert = httpUrl + "common/expert/info";
		String meeting = httpUrl + "common/meeting/search";
		String meetingInfo = httpUrl + "common/meeting/info";
		String Case = httpUrl + "common/case/search";
		String caseInfo = httpUrl + "common/case/info";
		String getnew = httpUrl + "common/note/getnew";
		String casemeeting = httpUrl + "common/casemeeting/search";
		String caseMeetingInfo = httpUrl + "common/casemeeting/info";

	}
}
